﻿using System.Collections.Generic;
using System.Text;
using System.Data;
using PPI.Entities;
using PPI.WebConsumer;
using VMind.Global;

namespace PPI.Client.Logic
{
    public class LVendor_Contacts
    {
        public static List<EVendor_Contact> SelectAllIdNameByVendor(int vendorID)
        {
            List<EVendor_Contact> _VendorContactList = new List<EVendor_Contact>();
            EVendor_Contact _VendorContact;
            DataSet ds = WVendor_Contacts.SelectAllIdNameByVendor(vendorID);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                _VendorContact = new EVendor_Contact();
                _VendorContact.Vendor_ContactId = ConvertHelper.ToInt32(dr["Vendor_ContactId"]);
                _VendorContact.Name = ConvertHelper.Tostring(dr["Name"]);
                _VendorContact.Vendor = new EVendor(ConvertHelper.ToInt32(dr["VendorFK"]));
                _VendorContactList.Add(_VendorContact);
            }
            return _VendorContactList;
        }

        public static List<EVendor_Contact> SelectAllIdName()
        {
            return SelectAllIdNameByVendor(0);
        }

    }
}
